<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <%@ include file="/WEB-INF/include/commoncss.jsp"%>
    <script type="text/javascript"
            src="${ctx}/javascript/laydate/laydate.js"></script>
</head>
<body>
<article class="page-container">
    <div action="" class="form form-horizontal" id="scheduleAdd">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>新密码：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input id="xYHMM" name="xYHMM" value="" class="input-text" type="password"/>
            </div>
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>确认密码：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input id="qYHMM" name="qYHMM" value="" class="input-text" type="password"/>
            </div>

        </div>


        <div class="row cl">
            <div class="col-xs-8  col-xs-offset-5 ">
                <button value="${YHZH}" type="button" class="btn btn-success radius" onClick="update_politic(this.value)">提交</button>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <button onClick="layer_close();" class="btn btn-default radius" type="button"> 关闭</button>
            </div>
        </div>
    </div>
    <%@ include file="/WEB-INF/include/commonjs.jsp"%>
    <script>
        function update_politic(value){
            var xYHMM=document.getElementById("xYHMM").value;
            var qYHMM=document.getElementById("qYHMM").value;

            if(xYHMM==""||xYHMM==null||qYHMM==""||qYHMM==null){
                layer.msg("*为必填项",{icon:2,time:2000});
                return;
            }
            else if(xYHMM!=qYHMM){
                layer.msg("两次密码不一致",{icon:2,time:2000});
                return;
            }
            layer.confirm("确认提交吗",{btn:['确定','取消']},function(){

                var url="${ctx}/RecorderManage/password_update.do";
                var parameter={YHZH:value,YHMM:xYHMM};
                $.post(url,parameter,function(data){
                    if(data=="修改成功"){
                        layer.msg(data,{icon:1,time:2000},function(){
                            parent.location.reload(true);
                        })
                    }else{
                        layer.msg(data,{icon:2,time:2000});
                    }
                })
            })
        }

    </script>
</article>


</body>

</html>